package main

import (
	"github.com/micro/go-micro"
	"lab-service/config"
	ps "lab-service/proto/security"
	"lab-service/security/handler"
	"log"
)

func main() {
	// Get service config
	srvConfig := config.GetConfig().SecurityService

	// Create a new service. Optionally include some options here.
	service := micro.NewService(
		micro.Name(srvConfig.Name),
		micro.Version(srvConfig.Version),
	)

	// Init will parse the command line flags.
	service.Init()

	// Register handler
	ps.RegisterSecurityHandler(service.Server(), new(handler.Security))

	// Run the server
	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
